package com.str.vo;

import com.str.utils.Retcode;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

/**
 * @author ZhangWu, Anything is possible!
 * @date 2022/3/31 8:53
 * @description
 */
@Data
@Builder
@AllArgsConstructor
public class ResponseVO {
    /**
     * 返回码
     */
    private String retcode;
    /**
     * 返回信息
     */
    private String retmsg;
    /**
     * 返回数据
     */
    private Object data;

    /**
     * 返回成功构造函数
     * @param data
     */
    public ResponseVO(Object data){
        this.retcode = Retcode.SUCCESS.code();
        this.retmsg = Retcode.SUCCESS.msg();
        this.data = data;
    }

    /**
     * 返回系统异常的构造函数
     */
    public ResponseVO(){
        this.retcode = Retcode.SYSTEM_EXCEPTION.code();
        this.retmsg = Retcode.SYSTEM_EXCEPTION.msg();
        this.data = data;
    }
}
